﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;

namespace WCS.Infrastructure.EFCore;

/// <summary>
/// 分账记录表
/// </summary>
[Table("DividedRecord")]
[Index("OrderId", Name = "DividedRecord_OrderId_idx", IsUnique = true)]
[Index("RecordNo", Name = "idx_DividedRecordNo", IsUnique = true)]
public partial class DividedRecord
{
    /// <summary>
    /// 分账记录ID
    /// </summary>
    [Key]
    [StringLength(32)]
    public string Id { get; set; } = null!;

    /// <summary>
    /// 分账记录编号
    /// </summary>
    [StringLength(32)]
    public string RecordNo { get; set; } = null!;

    /// <summary>
    /// 关联订单ID
    /// </summary>
    [StringLength(32)]
    public string OrderId { get; set; } = null!;

    /// <summary>
    /// 收款码ID
    /// </summary>
    [StringLength(32)]
    public string CodeId { get; set; } = null!;

    /// <summary>
    /// 分账协议ID
    /// </summary>
    [StringLength(32)]
    public string DividedAgreementId { get; set; } = null!;

    /// <summary>
    /// 分账总金额
    /// </summary>
    public long TotalDividedAmount { get; set; }

    /// <summary>
    /// 商户ID
    /// </summary>
    [StringLength(32)]
    public string? MerchantId { get; set; }

    /// <summary>
    /// 扩展属性
    /// </summary>
    public string? ExtraProperties { get; set; }

    /// <summary>
    /// 并发标记
    /// </summary>
    [StringLength(40)]
    public string? ConcurrencyStamp { get; set; }

    /// <summary>
    /// 创建时间
    /// </summary>
    [Column(TypeName = "timestamp(6) without time zone")]
    public DateTime CreationTime { get; set; }

    /// <summary>
    /// 创建者ID
    /// </summary>
    [StringLength(32)]
    public string? CreatorId { get; set; }

    /// <summary>
    /// 修改时间
    /// </summary>
    [Column(TypeName = "timestamp(6) without time zone")]
    public DateTime? LastModificationTime { get; set; }

    /// <summary>
    /// 修改者ID
    /// </summary>
    [StringLength(32)]
    public string? LastModifierId { get; set; }

    /// <summary>
    /// 门店ID
    /// </summary>
    [StringLength(32)]
    public string? StoreId { get; set; }

    /// <summary>
    /// 分账日期
    /// </summary>
    [Column(TypeName = "timestamp(0) without time zone")]
    public DateTime DividedDate { get; set; }
}
